package com.second.app.thread.p_c_test;

/**
 * @author gyz
 * @date 2021/1/25 17:38
 */
public class Main {
    public static void main(String[] args) {
        String lock = new String("");
        new Thread(() -> {
            Produce produce = new Produce(lock);
            while (true){
              produce.setValue();
            }
        },"生产线程").start();

        new Thread(() -> {
            Consumer consumer = new Consumer(lock);
            while (true){
                consumer.getValue();
            }
        },"消费线程").start();
    }
}
